import Layout from "@/layout";
import ParentView from "@/components/ParentView";

/**
 * 异步路由列表，模拟后台加载菜单后生成的路由数据
 */
export const asyncRoutes = [
  // 账户页面
  {
    path: "/account",
    component: Layout,
    redirect: "/account/account-index",
    meta: {
      title: "账户",
      icon: "ivu-icon ivu-icon-ios-person",
    },
    // alwaysShow: true,
    children: [
      {
        path: "account-index",
        name: "accountIndex",
        component: () => import("@/views/account/account-index"),
        meta: {
          title: "账户",
        },
        children: [
          // 默认路由跳转到首页
          {
            path: "/",
            redirect: "/account/account-index/staff-management",
            component: () => import("@/views/account/staff-management"),
          },
          {
            path: "staff-management",
            name: "staffManagement",
            component: () => import("@/views/account/staff-management"),
          },
          {
            path: "channel",
            name: "channel",
            component: () => import("@/views/account/channel"),
          }
        ],
      }
    ],
  },
  // 总控表
  {
    path: "/totalCtr",
    component: Layout,
    redirect: "/totalCtr/totalCtr-index",
    meta: {
      title: "总控表",
      icon: "ivu-icon ivu-icon-ios-contacts",
    },
    alwaysShow: true,
    children: [
      {
        path: "totalCtr-index",
        name: "totalCtrIndex",
        component: () => import("@/views/totalCtr/totalCtr-index"),
        meta: {
          title: "总控表",
        },
      },
      {
        path: "summaryData",
        name: "SummaryData",
        component: () => import("@/views/totalCtr/summaryData"),
        meta: {
          title: "汇总数据",
        },
      },
      {
        path: "dispatchControl",
        name: "dispatchControl",
        component: () => import("@/views/totalCtr/dispatchControl"),
        meta: {
          title: "调度排控",
        },
      }
    ],
  },
  // 客资页面
  {
    path: "/kezi",
    component: Layout,
    redirect: "/kezi/kezi-index",
    meta: {
      title: "客资",
      icon: "ivu-icon ivu-icon-ios-contacts",
    },
    // alwaysShow: true,
    children: [
      {
        path: "kezi-index",
        name: "keziIndex",
        component: () => import("@/views/kezi/kezi-index"),
        meta: {
          title: "客资",
        },
      }
    ],
  },
  // 订单页面
  {
    path: "/table",
    component: Layout,
    redirect: "/table/inline-edit-table",
    meta: {
      title: "订单",
      icon: "ivu-icon ivu-icon-md-checkmark-circle-outline",
    },
    // alwaysShow: true,
    children: [
      {
        path: "inline-edit-table",
        name: "InlineEditTable",
        component: () => import("@/views/table/inline-edit-table"),
        meta: {
          title: "订单",
        },
      }
    ],
  },
  ,
  // 产品页面
  {
    path: "/product",
    component: Layout,
    redirect: "/product/product-index",
    meta: {
      title: "产品管理",
      icon: "ivu-icon ivu-icon-md-checkmark-circle-outline",
    },
    alwaysShow: true,
    children: [
      {
        path: "series-index",
        name: "SeriesIndex",
        component: () => import("@/views/product/series-index"),
        meta: {
          title: "套系管理",
        },
      },
      {
        path: "product-index",
        name: "ProductIndex",
        component: () => import("@/views/product/product-index"),
        meta: {
          title: "产品管理",
        },
      }
    ]
  },

];
